package com.badger.spring.cloud.ribbon.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class DemoController {

    private static final String REST_URL_PREFIX = "http://BADGER-SPRING-CLOUD-API";

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/ribbon/demo")
    public String getAddress() {
        return restTemplate.getForObject(REST_URL_PREFIX + "/demo", String.class);
    }
}
